(function() {
  'use strict';

  angular
    .module('votingBackend')
    .run(runBlock)

    .run(['$rootScope', '$state', function($rootScope, $state) {

    $rootScope.$on('$stateChangeStart', function(evt, to, params) {
      if (to.redirectTo) {
        evt.preventDefault();
        $state.go(to.redirectTo, params)
      }
    });
}]);

  /** @ngInject */
  function runBlock($log) {

    $log.debug('runBlock end');
  }

})();
